package com.kangkang.leetcode20;

public class Test2028 {
    private static int[] missingRolls(int[] rolls, int mean, int n) {
        int sum = (rolls.length + n) * mean;
        for (int roll : rolls) {
            sum-=roll;
        }
        if(sum<n||sum>6*n){
            return new int[0];
        }else{
            int a = sum/n;
            int b = sum%n;
            int[] result =  new int[n];
            for (int i = 0; i < n; i++) {
                if(i<b){
                    result[i] = a+1;
                }else{
                    result[i] = a;
                }
            }
            return result;
        }

    }

    public static void main(String[] args) {

    }
}
